-- [BABEL-1625] expected value = 1912-11-25 12:24:32.0000000 +10:00
-- expected value = 1912-11-25 12:24:32.0000000 +10:00
CREATE VIEW BABEL_1625_vu_prepare_v1 AS (SELECT DATEADD(month, 1, cast('1912-10-25 12:24:32 +10:0' as DATETIMEOFFSET)));
GO

-- expected value = 1914-10-25 12:24:32.0000000 -10:52
CREATE VIEW BABEL_1625_vu_prepare_v2 AS (SELECT DATEADD(year, 2, cast('1912-10-25 12:24:32 -10:52' as DATETIMEOFFSET)));
GO

-- expected value = 1912-10-28 12:24:32.0000000 +06:45
CREATE VIEW BABEL_1625_vu_prepare_v3 AS (SELECT DATEADD(day, 3, cast('1912-10-25 12:24:32 +06:45' as DATETIMEOFFSET)));
GO

-- expected value = 1912-10-25 16:24:32.0000000 -11:37
CREATE VIEW BABEL_1625_vu_prepare_v4 AS (SELECT DATEADD(hour, 4, cast('1912-10-25 12:24:32 -11:37' as DATETIMEOFFSET)));
GO

-- expected value = 1912-10-25 12:29:32.0000000 +04:44
CREATE VIEW BABEL_1625_vu_prepare_v5 AS (SELECT DATEADD(minute, 5, cast('1912-10-25 12:24:32 +04:44' as DATETIMEOFFSET)));
GO

-- expected value = 1912-10-25 12:24:38.0000000 -02:23
CREATE VIEW BABEL_1625_vu_prepare_v6 AS (SELECT DATEADD(second, 6, cast('1912-10-25 12:24:32 -02:23' as DATETIMEOFFSET)));
GO

-- expected value = 2001-02-28 12:24:32.0000000 +10:00
CREATE PROCEDURE BABEL_1625_vu_prepare_p1 AS (SELECT DATEADD(year, 1, cast('2000-02-28 12:24:32 +10:0' as DATETIMEOFFSET)));
GO

-- expected value = 2000-03-28 12:24:32.0000000 +10:00
CREATE PROCEDURE BABEL_1625_vu_prepare_p2 AS (SELECT DATEADD(month, 1, cast('2000-02-28 12:24:32 +10:0' as DATETIMEOFFSET)));
GO

-- expected value = 2000-02-29 12:24:32.0000000 +10:00
CREATE PROCEDURE BABEL_1625_vu_prepare_p3 AS (SELECT DATEADD(day, 1, cast('2000-02-28 12:24:32 +10:0' as DATETIMEOFFSET)));
GO

-- expected value = 2000-02-28 13:24:32.0000000 +10:00
CREATE PROCEDURE BABEL_1625_vu_prepare_p4 AS (SELECT DATEADD(hour, 1, cast('2000-02-28 12:24:32 +10:0' as DATETIMEOFFSET)));
GO

-- expected value = 2000-02-28 12:25:32.0000000 +10:00
CREATE PROCEDURE BABEL_1625_vu_prepare_p5 AS (SELECT DATEADD(minute, 1, cast('2000-02-28 12:24:32 +10:0' as DATETIMEOFFSET)));
GO

-- expected value = 2000-02-28 12:24:33.0000000 +10:00
CREATE PROCEDURE BABEL_1625_vu_prepare_p6 AS (SELECT DATEADD(second, 1, cast('2000-02-28 12:24:32 +10:0' as DATETIMEOFFSET)));
GO

-- expected value = 1919-10-25 17:56:28.0000000 +11:59
CREATE FUNCTION BABEL_1625_vu_prepare_f1()
RETURNS DATETIMEOFFSET AS
BEGIN
RETURN (SELECT DATEADD(year, 7, cast('1912-10-25 17:56:28 +11:59' as DATETIMEOFFSET)));
END
GO

-- expected value = 1913-05-25 17:56:28.0000000 +11:59
CREATE FUNCTION BABEL_1625_vu_prepare_f2()
RETURNS DATETIMEOFFSET AS
BEGIN
RETURN (SELECT DATEADD(month, 7, cast('1912-10-25 17:56:28 +11:59' as DATETIMEOFFSET)));
END
GO

-- expected value = 1912-11-01 17:56:28.0000000 +11:59
CREATE FUNCTION BABEL_1625_vu_prepare_f3()
RETURNS DATETIMEOFFSET AS
BEGIN
RETURN (SELECT DATEADD(day, 7, cast('1912-10-25 17:56:28 +11:59' as DATETIMEOFFSET)));
END
GO

-- expected value = 1912-10-26 00:56:28.0000000 +11:59
CREATE FUNCTION BABEL_1625_vu_prepare_f4()
RETURNS DATETIMEOFFSET AS
BEGIN
RETURN (SELECT DATEADD(hour, 7, cast('1912-10-25 17:56:28 +11:59' as DATETIMEOFFSET)));
END
GO

-- expected value = 1912-10-25 18:03:28.0000000 +11:59
CREATE FUNCTION BABEL_1625_vu_prepare_f5()
RETURNS DATETIMEOFFSET AS
BEGIN
RETURN (SELECT DATEADD(minute, 7, cast('1912-10-25 17:56:28 +11:59' as DATETIMEOFFSET)));
END
GO

-- expected value = 1912-10-25 17:56:35.0000000 +11:59
CREATE FUNCTION BABEL_1625_vu_prepare_f6()
RETURNS DATETIMEOFFSET AS
BEGIN
RETURN (SELECT DATEADD(second, 7, cast('1912-10-25 17:56:28 +11:59' as DATETIMEOFFSET)));
END
GO
